<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var str='12 fff 34 rt455 455 666';
        alert(str.match(/\d{3}/))
    </script>
</head>
<body>

</body>
</html>